#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/9/20 09:32
# @Author  : youfeng
from .logger import AppLogger
from .store.redis_handler import RedisResultHandler

log = AppLogger('mongo_demo.log').get_logger()


class RedisDataCacheConfig(object):
    HOST = "192.168.0.95"
    PORT = 6379
    PASSWORD = 'haizhi@)'
    DB = 0
    MAX_CONNECTIONS = 200


def main():
    redis_result_handler = RedisResultHandler(host=RedisDataCacheConfig.HOST,
                                              port=RedisDataCacheConfig.PORT,
                                              password=RedisDataCacheConfig.PASSWORD,
                                              db=RedisDataCacheConfig.DB,
                                              max_connections=RedisDataCacheConfig.MAX_CONNECTIONS,
                                              log=log)

    redis_result_handler.save_gsxt("北京海致星图科技有限公司", [{"key_person": {"xxx": "xxx"}}])

    redis_result_handler.save_news("北京海致星图科技有限公司", [{"keyword": "xxx"}, {}, {}, {}])

    redis_result_handler.save_shixin("北京海致星图科技有限公司", [{"case_id": "xxx"}, {}, {}, {}])

    redis_result_handler.save_zhixing("北京海致星图科技有限公司", [{"case_id": "xxx"}, {}, {}, {}])

    redis_result_handler.save_wenshu("北京海致星图科技有限公司", [{"case_id": "xxx"}, {}, {}, {}])


if __name__ == '__main__':
    main()
